package com.zzty.txj.dao;

import com.zzty.txj.entity.DoDaily;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface DoDailyMapper {

    @Select("select * from doDaily where date=#{date} and userId=#{userId}")
    List<DoDaily> getRecordByDateAndId(DoDaily doDaily);

    @Update("update doDaily set finalResult=#{finalResult} where id=#{id}")
    Integer updateRecordById(DoDaily doDaily);

    @Select("select * from doDaily where id=#{id}")
    DoDaily getDoDailyById(Integer id);

    @Select("select * from doDaily where date>=#{date} and userId=#{userId}")
    List<DoDaily> getDoDailyByDateAndUser(DoDaily doDaily);

    @Select("select * from doDaily where userId=#{userId}")
    List<DoDaily> getDoDailyByUserId(Integer userId);
}
